<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?echo $this->title; ?></title>
<link rel="stylesheet" type="text/css" href="<?=$this->baseUrl?>/public/css/ext-all.css" />
<script type="text/javascript" src="<?=$this->baseUrl?>/public/js/ext-base.js"></script>
<script type="text/javascript" src="<?=$this->baseUrl?>/public/js/ext-all.js"></script>
</head>
<script type="text/javascript">
Ext.QuickTips.init();
Ext.onReady(function(){
//定义初始化					 
Ext.BLANK_IMAGE_URL = '<?=$this->baseUrl?>/public/images/default/s.gif';
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());	
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
LoginWindow=Ext.extend(Ext.Window,{
title : '登陆plima系统',       
width : 265,           
height : 170,       
collapsible : true,
defaults : {           
border : false
},
buttonAlign : 'center'
});
var form_add=new Ext.FormPanel({								   
		labelAlign:'top',
		frame:true,
		plain:true,
		title:'user register',
		buttonAlign : 'center',  
		bodyStyle:'padding:5px',
		width:600,
		items:[{
			   layout:'column',
			   border:false,
			   items:[{
			   		columnWidth:.5,
					layout:'form',
					border:false,
					items:[{
						   xtype:'textfield',
						   fieldLabel:'realname',
						   name:'realname',
						   anchor:'80%',
						   allowBlank:false
						   },
						   {
						   xtype:'textfield',
						   fieldLabel:'password',
						   name:'pwd1',
						   inputType : 'password',
						   anchor:'80%',
						   allowBlank:false
						   },
						   {
						   xtype:'textfield',
						   fieldLabel:'Email',
						   name:'email',
						   value:'2@2.com',
						   anchor:'80%',
						   allowBlank:false,
						   vtype:'email'
						   }]
					  },
					  {
			   		columnWidth:.5,
					layout:'form',
					border:false,
					items:[{
						   xtype:'textfield',
						   fieldLabel:'username',
						   name:'username',
						   anchor:'80%',
						   allowBlank:false
						   },
						   {
						   xtype:'textfield',
						   fieldLabel:'repeat password',
						   name:'pwd2',
						   inputType : 'password',
						   anchor:'80%'
						   }]
					  }]			   
			   }],
		buttons:[{
				 text:'save',
				 name:'submit',
				 id:'save',
				 handler:function(){
					 if(form_add.getForm().isValid()){
					 form_add.getForm().submit({
							waitTitle: '提示',
							waitMsg:'waiting',
							url:'<?=$this->baseUrl?>/user/add',
							method:'post',
							success:function(form,action){
								var temp=Ext.util.JSON.decode(action.response.responseText);
								Ext.MessageBox.alert('反反复反复反复反复反复反反复',temp.msg);
								},
							failure:function(form,action){
								var temp=Ext.util.JSON.decode(action.response.responseText);
								Ext.MessageBox.alert('waring',temp.msg);
								}
							});
					 }}
				 },
				 {
				text:'cancel',	 
				name:'cancel',
				id:'cancel'
				}]
	});
	form_add.render(document.body);

});
</script>
<body>
</body>
</html>
